const fs=require('fs')
const path=require('path')
const jwt=require('jsonwebtoken')
const secret="dataSpace"

var generate=(payload,day,result)=>{
    result(jwt.sign(payload,secret,{expiresIn:60*60*day}))
}

var verify=(token,result)=>{
    jwt.verify(token,secret,(err,decode)=>{
        result(decode)
    })
}

var resolve=(token,result)=>{
}

exports.generate=generate
exports.verify=verify